package com.example.framework509.codeGen.entity.middlePojp;

import com.example.framework509.codeGen.entity.Field;
import com.example.framework509.codeGen.utils.StringUtil;

import java.util.List;

public class FieldContainer {

    private Integer id;

    private String name;

    private String nameUpper;

    private String nameLower;

    private String nameUnder;

    private Integer length;

    private String pattern;

    private String defaultValue;

    private String remark;

    private String dataType;

    private List<String> annotations;

    public FieldContainer(Field field, List<String> annotations) {

        String nameUpper = StringUtil.firstUpperCase(StringUtil.upperCase_(field.getName()));
        String nameLower = StringUtil.firstLowerCase(StringUtil.upperCase_(field.getName()));
        String nameUnder = StringUtil.toUnderScoreCase(StringUtil.upperCase_(field.getName()));
        this.id = field.getId();
        this.nameUpper = nameUpper;
        this.nameLower = nameLower;
        this.nameUnder = nameUnder;
        this.length = field.getLength();
        this.pattern = field.getPattern();
        this.defaultValue = field.getDefaultValue();
        this.remark = field.getRemark();
        this.dataType = field.getDataType();
        this.annotations = annotations;
    }

    @Override
    public String toString() {
        return "FieldContainer{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", nameUpper='" + nameUpper + '\'' +
                ", nameLower='" + nameLower + '\'' +
                ", nameUnder='" + nameUnder + '\'' +
                ", length=" + length +
                ", pattern=" + pattern +
                ", defaultValue='" + defaultValue + '\'' +
                ", remark='" + remark + '\'' +
                ", dataType='" + dataType + '\'' +
                ", annotations=" + annotations +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPattern() {
        return pattern;
    }

    public void setPattern(String pattern) {
        this.pattern = pattern;
    }

    public String getNameUpper() {
        return nameUpper;
    }

    public void setNameUpper(String nameUpper) {
        this.nameUpper = nameUpper;
    }

    public String getNameUnder() {
        return nameUnder;
    }

    public void setNameUnder(String nameUnder) {
        this.nameUnder = nameUnder;
    }

    public String getDataType() {
        return dataType;
    }

    public void setDataType(String dataType) {
        this.dataType = dataType;
    }

    public List<String> getAnnotations() {
        return annotations;
    }

    public String getNameLower() {
        return nameLower;
    }

    public void setNameLower(String nameLower) {
        this.nameLower = nameLower;
    }

    public void setAnnotations(List<String> annotations) {
        this.annotations = annotations;
    }

    public Integer getLength() {
        return length;
    }

    public void setLength(Integer length) {
        this.length = length;
    }

    public String getDefaultValue() {
        return defaultValue;
    }

    public void setDefaultValue(String defaultValue) {
        this.defaultValue = defaultValue;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}
